<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/emr/css/emr-ui.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/datapicker/datepicker3.css}" rel="stylesheet"/>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-zhikong-edit" th:object="${zhikong}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
            <div class="form-group">	
                <label class="col-sm-3 control-label">病人姓名：</label>
                <div class="col-sm-8">
                    <input id="bingrenId" style="background: white;" name="bingrenId" th:field="*{bingrenId}" class="form-control" type="text" disabled="disabled">
                </div>
            </div>
            <div class="form-group" style="display: none;">	
                <label class="col-sm-3 control-label">病人ID：</label>
                <div class="col-sm-8">
                    <input id="pertiendId" style="background: white;" name="pertiendId" th:field="*{pertiendId}" class="form-control" type="text">
                </div>
            </div>
            
            <div class="form-group">	
                <label class="col-sm-3 control-label">主治医生：</label>
                <div class="col-sm-8">
                    <input id="zhiliaoyishengId" style="background: white;" name="zhiliaoyishengId" th:field="*{zhiliaoyishengId}" class="form-control" type="text" disabled="disabled">
                </div>
            </div>
            <div class="form-group">
				<label class="col-sm-3 control-label">疾病名称：</label>
				<div class="col-sm-8">
					<select id="icdCode" name="icdCode" style="background: white;" class="form-control"  disabled="disabled">
						<option th:each="post:${posts}" th:value="${post.id}" th:text="${post.idcName}" th:selected="${post.flag}"></option>
					</select>
					
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label">是否合格：</label>
				<div class="col-sm-8">
					<select class="form-control" id="shYesOnNo" name="shYesOnNo" th:field="*{shYesOnNo}">
				        <option th:value="合格" th:selected="${shYesOnNo == '合格'?true : false}">合格</option>
				        <option th:value="不合格" th:selected="${shYesOnNo == '不合格'?true : false}">不合格</option>
				    </select>
				</div>
			</div>
            
            <div class="form-group">	
                <label class="col-sm-3 control-label">不合格原因：</label>
                <div class="col-sm-8">
                    <input id="noNeirong" name="noNeirong" th:field="*{noNeirong}" class="form-control" type="text">
                </div>
            </div>
            <div class="col-md-12">
			    <div class="form-group">
			        <label class="col-sm-3 control-label">质控时间：</label>
			        <div class="col-sm-9">
			            <div class="form-group">
			                <div class="input-group date"> <span class="input-group-addon" style="height: 34px;" ><i class="fa fa-calendar"></i></span>
			                    <input style="width: 443px;position: absolute;" type="text" id="zhikongDate" name="zhikongDate" th:field="*{zhikongDate}" class="form-control" >
			                </div>
			            </div>
			        </div>
			    </div>
			</div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">质控人：</label>
                <div class="col-sm-8">
                    <input id="zhikongRen" name="zhikongRen" style="background: white;" th:field="*{zhikongRen}" class="form-control" type="text" disabled="disabled">
                </div>
            </div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script th:src="@{/js/jquery-ui-1.10.4.min.js}"></script>
	<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
	<script th:src="@{/ajax/libs//datapicker/bootstrap-datepicker.js}"></script>
	
	<script th:src="@{/ajax/libs/beautifyhtml/beautifyhtml.js}"></script>
	<script>
	    $(document).ready(function(){setup_draggable();$("#n-columns").on("change",function(){var v=$(this).val();if(v==="1"){var $col=$(".form-body .col-md-12").toggle(true);$(".form-body .col-md-6 .draggable").each(function(i,el){$(this).remove().appendTo($col)});$(".form-body .col-md-6").toggle(false)}else{var $col=$(".form-body .col-md-6").toggle(true);$(".form-body .col-md-12 .draggable").each(function(i,el){$(this).remove().appendTo(i%2?$col[1]:$col[0])});$(".form-body .col-md-12").toggle(false)}});$("#copy-to-clipboard").on("click",function(){var $copy=$(".form-body").clone().appendTo(document.body);$copy.find(".tools, :hidden").remove();$.each(["draggable","droppable","sortable","dropped","ui-sortable","ui-draggable","ui-droppable","form-body"],function(i,c){$copy.find("."+c).removeClass(c).removeAttr("style")});var html=html_beautify($copy.html());$copy.remove();$modal=get_modal(html).modal("show");$modal.find(".btn").remove();$modal.find(".modal-title").html("复制HTML代码");$modal.find(":input:first").select().focus();return false})});var setup_draggable=function(){$(".draggable").draggable({appendTo:"body",helper:"clone"});$(".droppable").droppable({accept:".draggable",helper:"clone",hoverClass:"droppable-active",drop:function(event,ui){$(".empty-form").remove();var $orig=$(ui.draggable);if(!$(ui.draggable).hasClass("dropped")){var $el=$orig.clone().addClass("dropped").css({"position":"static","left":null,"right":null}).appendTo(this);var id=$orig.find(":input").attr("id");if(id){id=id.split("-").slice(0,-1).join("-")+"-"+(parseInt(id.split("-").slice(-1)[0])+1);$orig.find(":input").attr("id",id);$orig.find("label").attr("for",id)}$('<p class="tools col-sm-12 col-sm-offset-3">						<a class="edit-link">编辑HTML<a> | 						<a class="remove-link">移除</a></p>').appendTo($el)}else{if($(this)[0]!=$orig.parent()[0]){var $el=$orig.clone().css({"position":"static","left":null,"right":null}).appendTo(this);$orig.remove()}}}}).sortable()};var get_modal=function(content){var modal=$('<div class="modal" style="overflow: auto;" tabindex="-1">	<div class="modal-dialog"><div class="modal-content"><div class="modal-header"><a type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</a><h4 class="modal-title">编辑HTML</h4></div><div class="modal-body ui-front">	<textarea class="form-control" 	style="min-height: 200px; margin-bottom: 10px;font-family: Monaco, Fixed">'+content+'</textarea><button class="btn btn-success">更新HTML</button></div>				</div></div></div>').appendTo(document.body);return modal};$(document).on("click",".edit-link",function(ev){var $el=$(this).parent().parent();var $el_copy=$el.clone();var $edit_btn=$el_copy.find(".edit-link").parent().remove();var $modal=get_modal(html_beautify($el_copy.html())).modal("show");$modal.find(":input:first").focus();$modal.find(".btn-success").click(function(ev2){var html=$modal.find("textarea").val();if(!html){$el.remove()}else{$el.html(html);$edit_btn.appendTo($el)}$modal.modal("hide");return false})});$(document).on("click",".remove-link",function(ev){$(this).parent().parent().remove()});
	    $(".input-group.date").datepicker({todayBtn: "linked",keyboardNavigation: !1,forceParse: !1,calendarWeeks: !0,autoclose: !0});
	</script>
    <script type="text/javascript">
		var prefix = ctx + "module/zhikong"
		$("#form-zhikong-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-zhikong-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
